package high.concurrent.feign;

import high.concurrent.request.LockProductRequest;
import high.concurrent.utils.JsonData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "product")
public interface ProductFeignService {


    /**
     * 查询购物车商品项的最新价格，并删除对应购物车商品
     * @param productIdList
     * @return
     */
    @PostMapping("/api/cart/v1/getCartItemLatestPrice")
    JsonData getCartItemLatestPrice(@RequestBody List<Long> productIdList);

    /**
     * 购物车所有商品项锁定
     * @param lockProductRequest
     * @return
     */
    @PostMapping("/api/product/v1/lockProduct")
    JsonData lockProduct(@RequestBody LockProductRequest lockProductRequest);
}
